def sum_matrix_col(mx, col, default=0, scale=2):
    ret = 0
    for row in mx:
        num = row[col]
        try:
            ret = ret + float(num)
        except ValueError:
            ret = ret + default
    return round(ret, scale)


def fetch_dict_dim(d, dim):
    ret = []
    for key in d.keys():
        ret.append(d[key][dim])
    return ret
